﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Linq;
namespace Exact_Extension
{
    public partial class TaxDeclareForm : DevExpress.XtraEditors.XtraForm
    {
        ExactDataContext DS;
        IFormatProvider culture = new System.Globalization.CultureInfo("fr-FR", true);
        public TaxDeclareForm(ExactDataContext _DS)
        {
            InitializeComponent();
            DS = _DS;
        }

        private void btnExport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.gridControl_VAT.ShowPrintPreview();
        }

        private void btnLoad_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DateTime FromDate = Convert.ToDateTime(Convert.ToDateTime(this.FromDateEdit.EditValue).ToString("dd/MM/yyyy"),culture);
            DateTime ToDate = Convert.ToDateTime(Convert.ToDateTime(this.ToDateEdit.EditValue).ToString("dd/MM/yyyy"),culture);
            var query = from VATOut in DS.ISHCMC_EXACT_VATOutput_Function(FromDate, ToDate)
                        select VATOut;
            this.iSHCMCEXACTVATOutputFunctionResultBindingSource.DataSource = query;
        }
    }
}